UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NjBhcE8aGfdczJZlK99dVNQ8icwnmMr9MAQDe3x+v1A=' 
WHERE 
  key_id = '2962b013a0c9db3bedd7e2655b7bb699dfbd6d488f8cc25beef0e3326c35aac6' 
  AND (
    token = 'NjBhcE8aGfdczJZlK99dVNQ8icwnmMr9MAQDe3x+v1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029