UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MrF3J9h+J9ewvLOwhtLLU9DpTtC/njhQ882hm7urRoo='
WHERE
key_id = 'f24d523db39f4708d04c8ed206b41c5b49e832b0c8966f4ac92c9959e00137f6'
AND (
token = 'MrF3J9h+J9ewvLOwhtLLU9DpTtC/njhQ882hm7urRoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)