UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4UzjIDKp1YuQ8sCvNxe6RJApSD7C3otp7CGa/moRqSQ=' 
WHERE 
  key_id = '198a9ff3102d26274c96b8292d104f73b81676661f19a192fec63733a6c11f7e' 
  AND (
    token = '4UzjIDKp1YuQ8sCvNxe6RJApSD7C3otp7CGa/moRqSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041