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