UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DO9LYtIlnlS2LPLmrY1OPPpp7p9zELw+8vSi/Zumqzs=' 
WHERE 
  key_id = '82ef2a1a5a35111f7585ca7ad57e9404029812d34637c420221c3a8419a8fbc8' 
  AND (
    token = 'DO9LYtIlnlS2LPLmrY1OPPpp7p9zELw+8vSi/Zumqzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024