UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wFV143jscG80/OEYIggLqvNE1vMUyB5pblOH/sgSC+Y='
WHERE
key_id = '2adcf05002da5449338d2e407133955224ad4befa498ced0830c849782106551'
AND (
token = 'wFV143jscG80/OEYIggLqvNE1vMUyB5pblOH/sgSC+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)