UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dVn7YMjkHJbjSrTOtiY2UEThdrNtKzt4FdRfkiRNZAU=' 
WHERE 
  key_id = '99f6693aaac0c68b17652654a95027bf7f8e2b460c12088bd467a38132d46ced' 
  AND (
    token = 'dVn7YMjkHJbjSrTOtiY2UEThdrNtKzt4FdRfkiRNZAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016