UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZSCgsWUvg6IpTcjPS134jR3DcoT/9wJ1+eUA4UWwurA='
WHERE
key_id = '085f4ffb69cfa97f1e242b0f63ed1afa86fbf3f640868afe8678f77b30f0eee0'
AND (
token = 'ZSCgsWUvg6IpTcjPS134jR3DcoT/9wJ1+eUA4UWwurA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)