UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GivUiW4cMJe3x2tig6lN5Xe+N3k5u/GQMIKS3paEZ5A=' 
WHERE 
  key_id = '2bd4f66492e519b006432c8c9f1bb8ba3ef5f86eb91deaeca3b196e6f3969e17' 
  AND (
    token = 'GivUiW4cMJe3x2tig6lN5Xe+N3k5u/GQMIKS3paEZ5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032