UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yiDKzv0pmDaR/CahPM/JkpsV0vV7QKX2Gq1Nzl4NDiU='
WHERE
key_id = 'a41747201197b5b21859a405f3d700d9f036227248eaa6dcc9e4024297c61c1a'
AND (
token = 'yiDKzv0pmDaR/CahPM/JkpsV0vV7QKX2Gq1Nzl4NDiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)