UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AnXbRVOdSaxpEwC2qD1+uolJhEIw6q1fZEJ84Ox2HTI=' 
WHERE 
  key_id = '922d67122c3bd48e65f88285a9a5e7d1edeeb97e1a97ff4619972f9f8a5e8291' 
  AND (
    token = 'AnXbRVOdSaxpEwC2qD1+uolJhEIw6q1fZEJ84Ox2HTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049