UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xdrsu3Dq86P1b6Sor46PC6x5foMQdj4u+ew4PVv/qTM='
WHERE
key_id = '8c808cb147d44144adeecf2b1dc9e42bd56b44fba24cf091bb81921a1f0b02b3'
AND (
token = 'xdrsu3Dq86P1b6Sor46PC6x5foMQdj4u+ew4PVv/qTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)