UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ZqttXHOzcp+TuYf8Rxk/SPEbFpfECkY/uy9KQeIi/g=' 
WHERE 
  key_id = '217ed6cd08369d6f7539a4da28213b58a7bced64a6dfd592098bff7c0bc8858a' 
  AND (
    token = '9ZqttXHOzcp+TuYf8Rxk/SPEbFpfECkY/uy9KQeIi/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023