UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '01Fa/dqe76vRgm6LzW9+SIA+WcipAphH8JynhbURPUY='
WHERE
key_id = 'd4549d03c3179739743c4f6d13ab0515b6671a5ea0dba0c755df9a6c4cf7ba8c'
AND (
token = '01Fa/dqe76vRgm6LzW9+SIA+WcipAphH8JynhbURPUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)