UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P/n7OtH/W4csg+SlJjSorHN+/W6PJ1epppBY0htakrw=' 
WHERE 
  key_id = '85258f3e2ac1dd69da36a25cc5f25d43c1f4b96b60ed8798c8070a5ab322ae6a' 
  AND (
    token = 'P/n7OtH/W4csg+SlJjSorHN+/W6PJ1epppBY0htakrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050