UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mQuZwVFWgF2PQiOJlQqXBGzzQMlUEUTnX81/PEdWMnM='
WHERE
key_id = 'f8159c9cd6a9b63dbc4297dcaa2f5c344b95f024e9c5d45ac576bd3338ec9ee6'
AND (
token = 'mQuZwVFWgF2PQiOJlQqXBGzzQMlUEUTnX81/PEdWMnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)