UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j4TvtTLYuyqU9cljsSze2VHC0BJ5Hm+yZk7RRHqQ+MA='
WHERE
key_id = '4d454488e29383a4d8e7d4f56042acd0fd334b58fb37dd06ec5637d2a476cdc0'
AND (
token = 'j4TvtTLYuyqU9cljsSze2VHC0BJ5Hm+yZk7RRHqQ+MA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)