UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '71qzcKqzuVbsY51HfzxOSAwxTQMflMLN8b4RiCNX/rk='
WHERE
key_id = '2869977207048daf31bad865f64c6f04b45934fd603288238ac41521ac4ba999'
AND (
token = '71qzcKqzuVbsY51HfzxOSAwxTQMflMLN8b4RiCNX/rk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)