UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g5aUmjSJ1WZaN30/wZPRUKxowBrPoxnx8nxLOaBt/aU=' 
WHERE 
  key_id = '950fd7777f3b0c85217098cd4e297fdcaf73ac14d1fb45f6d1648f4b399a4fc6' 
  AND (
    token = 'g5aUmjSJ1WZaN30/wZPRUKxowBrPoxnx8nxLOaBt/aU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018