UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5pToUFPTSwbgigY3ZE9hHFKoC9iU38hKCP+Y2oWLrbk='
WHERE
key_id = '61182ef29eedbcfbf7db03059b0491d83cf68744fc7ef3d97074925e9a20f7e4'
AND (
token = '5pToUFPTSwbgigY3ZE9hHFKoC9iU38hKCP+Y2oWLrbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)