UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FhcjHt++zFv8PWnuEsjYqOJrZngB2i00mZZANO1rxDc=' 
WHERE 
  key_id = 'fd418aa7d7c497c384d9bb361fdc96cbece60ec2ece9db227f4bf7f90ca77389' 
  AND (
    token = 'FhcjHt++zFv8PWnuEsjYqOJrZngB2i00mZZANO1rxDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037