UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gurQhPTGHxIjNV42I4VIglnwfvoHmH70C4OtBpkShlU=' 
WHERE 
  key_id = 'd75bfa5754db46cb4ac6b1c29fb55b9a30fa9d38a127eed2fffb72a748070360' 
  AND (
    token = 'gurQhPTGHxIjNV42I4VIglnwfvoHmH70C4OtBpkShlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027