UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ta5o8lHK4q67wbQfUQ8+RQdM2aK1lKzjxYUKxIIQdKY=' 
WHERE 
  key_id = '7acfb12accd81ef62f21bdbc25df38861da258e033641f574d03e2a4c59e7e6d' 
  AND (
    token = 'Ta5o8lHK4q67wbQfUQ8+RQdM2aK1lKzjxYUKxIIQdKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032