UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5gWHG9OW6j7yXqw+GUDgJ/aW7cBlHvuFYAb3kwxLY8U=' 
WHERE 
  key_id = '6d7c7436ed561c4a400ed0ad3537b34b2bb89f126d5fa31c49b1d744838c134f' 
  AND (
    token = '5gWHG9OW6j7yXqw+GUDgJ/aW7cBlHvuFYAb3kwxLY8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034