UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H+wRjw7Rzq/dXGxjQa9J7y0Uh1XmJc4u1yxwpAWq6KY=' 
WHERE 
  key_id = 'c0006e8d8ae9536f0429dfcfabb8885f5b98b933c895cce1a4fb3d5f15c939af' 
  AND (
    token = 'H+wRjw7Rzq/dXGxjQa9J7y0Uh1XmJc4u1yxwpAWq6KY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051