UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rKUZr2FEx0ggh+CMo81GRUaonxAnwfwFVyOrlZZegtQ=' 
WHERE 
  key_id = 'ccd31e831edac9afd03394b63a0bfb5758d3797b8212bc06a82a0ebb892f4e45' 
  AND (
    token = 'rKUZr2FEx0ggh+CMo81GRUaonxAnwfwFVyOrlZZegtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027