UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kfRI4+YkhVUE/gfFtCbEFyWm2IPXlNHnr5/K9Mao0Pk='
WHERE
key_id = '242fa2890666f65dd98703155038277bb1c643d8a947dc20bbc3b2bf4a5e258b'
AND (
token = 'kfRI4+YkhVUE/gfFtCbEFyWm2IPXlNHnr5/K9Mao0Pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)