UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WzXa5JaXOc0svbxbH0S6qmbV0imPhHdh0VLgxVyj9dU=' 
WHERE 
  key_id = '14266371d31dc563a7a6d738766dd1e07f4c8d8f798e27ea4cb48a48ebece78c' 
  AND (
    token = 'WzXa5JaXOc0svbxbH0S6qmbV0imPhHdh0VLgxVyj9dU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033