UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2S5J2a/Wsm2IyKYd2fjuL6nW7EwrfXhTDf5U5dFzeyg='
WHERE
key_id = 'c708cf26c0cf2700b2a3d2940884fd25ef3bbb878c017742ebac37dc88d03884'
AND (
token = '2S5J2a/Wsm2IyKYd2fjuL6nW7EwrfXhTDf5U5dFzeyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)