UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kmrkjoMS855CyAuTy5JagTodrvCU8SvRIjod5fPeVQI='
WHERE
key_id = 'af083f4840066188e2ade60e9a932e78e1c2756166d8c07936c36b975872ca1c'
AND (
token = 'kmrkjoMS855CyAuTy5JagTodrvCU8SvRIjod5fPeVQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)