UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CiBVI3R9nKqZlyUbq78cSMitKkUELaUPCT6hyDMxNSg='
WHERE
key_id = '622ec1c5c5a1be85655473bfbb0b4d74e5d9abc2761e84b53029d095c8d89f34'
AND (
token = 'CiBVI3R9nKqZlyUbq78cSMitKkUELaUPCT6hyDMxNSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)