UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jo6ivseaV8khoG0TwUr8Ov8uy3P8U1AonfGIs9Ujd7Y='
WHERE
key_id = '613ab4f45d425b99725ffa1af5c49a5e86d00107e3bb800d3cabc3a4ca4d6862'
AND (
token = 'jo6ivseaV8khoG0TwUr8Ov8uy3P8U1AonfGIs9Ujd7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)