UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qfQKAQKN1gh+mHfIG5I38CuPX1fxRIHBkJ07egR/JIw='
WHERE
key_id = '5c3208b564444ca0018693157b0456176b592e7d7db3ff29b83fa48d7f1f8f2b'
AND (
token = 'qfQKAQKN1gh+mHfIG5I38CuPX1fxRIHBkJ07egR/JIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)