UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hG+JE+kg4go6MO0NJ1jzCllZF+TReCF4WHDCBpTX6wU=' 
WHERE 
  key_id = '99eb8ebe17f2dfcb28a9d6b6384fdee5950294dc5339e96921c5f44860c03d27' 
  AND (
    token = 'hG+JE+kg4go6MO0NJ1jzCllZF+TReCF4WHDCBpTX6wU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020