UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cqx0gbyENEcelWCBbjUIeNHIcHT+TyPCkYkS/DpWhXc='
WHERE
key_id = 'ab424aa6a5aea599b1c96353cb514c64bf323826b1e7e1ebaed361c10af7a8b2'
AND (
token = 'Cqx0gbyENEcelWCBbjUIeNHIcHT+TyPCkYkS/DpWhXc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)