UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZU8rwimiWN+Kv85XTcsp6sin2UgQYZ6Dp+KWY5xXbhg=' 
WHERE 
  key_id = 'd9e936cab3336b08c403d227814875326c072760c06a3de757a9b403d4db2c9f' 
  AND (
    token = 'ZU8rwimiWN+Kv85XTcsp6sin2UgQYZ6Dp+KWY5xXbhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043