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

Query time 0.00044