UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HMTmaYT9qDOwGx1U0D0l++QtqKdn0kcJNbQD6RHL+uU='
WHERE
key_id = 'b736bb4f532dfb790cef777a1d2cd5788b08b795c5a46639da6cf517feb5efcf'
AND (
token = 'HMTmaYT9qDOwGx1U0D0l++QtqKdn0kcJNbQD6RHL+uU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)