UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rxT/m9z8O0/zrzkYabqKaLJhUhEdN0Lophn4d3TVVk='
WHERE
key_id = '246b97c85cad63f16cf0085890d6dc7817eac6abe6ec7100bff74a1a1b85bd07'
AND (
token = '3rxT/m9z8O0/zrzkYabqKaLJhUhEdN0Lophn4d3TVVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)