UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qxwREsZK+a6qODNqWYVTvcAAPVRzt7e0tQrYGZ+gqpA=' 
WHERE 
  key_id = '437199b233ec25e22d2a5e022225c4f276d6a3a72864a3d3e4b834d67354bf69' 
  AND (
    token = 'qxwREsZK+a6qODNqWYVTvcAAPVRzt7e0tQrYGZ+gqpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036